// import router from "@/router";
//用户信息
const state = {
  userInfo: {},
  token: "",
  isLogin: false,
  isFirstLogin: true,
  asyncRoutes: [], //后台返回的全局动态路由
};
const mutations = {
  SET_USER_INFO(state, data) {
    state.userInfo = data;
  },
};
const actions = {
  // 登录
  // Login({ commit, dispatch, state }, userInfo) {
  // return new Promise((resolve, reject) => {
  // login(username, password, code, uuid)
  //   .then((res) => {
  //     let data = res.data;
  //     setToken(data.access_token);
  //     commit("SET_TOKEN", data.access_token);
  //     setExpiresIn(data.expires_in);
  //     commit("SET_EXPIRES_IN", data.expires_in);
  //     resolve();
  //   })
  //   .catch((error) => {
  //     reject(error);
  //   });
  // });
  // },
  // 获取用户信息 筛选有权限的路由添加信息
  // router.addRoutes()
};
const getters = {};
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
};
